from django.db import models
from django.contrib.auth.models import AbstractUser

# Create your models here.
class UserProfile(AbstractUser):
    nickname = models.CharField(max_length=30, verbose_name="昵称", null=True)
    phone = models.CharField(max_length=11, verbose_name="电话")
    avatar = models.ImageField(upload_to="avatar", null=True, verbose_name="头像")
    sign = models.CharField(max_length=50, verbose_name="个性签名", default="掳起袖子加油干")
    info = models.CharField(max_length=1024, verbose_name="个人介绍", default="",null=True)
    updated_time = models.DateTimeField(auto_now=True)

    class Meta:
        verbose_name = "用户"              #管理界面用中文显示，单数
        verbose_name_plural = "用户"       #管理界面用中文显示，复数
        db_table = "user_profile"
    def __str__(self):
        return self.username

